package simple;

import java.util.Scanner;

/**
 * MT24 吃鱼
 * @author d3y1
 */
public class MT24{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);

        while(in.hasNext()){
            solution(in);
        }
    }

    /**
     * 模拟法: 贪心
     *
     * 举例子找规律
     *
     * 示例1:
     * n=3 m=4, 表示抓了3条鱼(A B C)(1 2表示正反面), 可同时煎4条鱼
     * 1min: A1 B1 C1
     * 2min: A2 B2 C2
     *
     * 示例2:
     * n=4 m=3, 表示抓了4条鱼(A B C D)(1 2表示正反面), 可同时煎3条鱼
     * 1min: A1 B1 C1
     * 2min: D1 A2 B2
     * 3min: C2 D2
     *
     * @param in
     */
    private static void solution(Scanner in){
        // n条鱼
        int n = in.nextInt();
        // 同时煎m条鱼
        int m = in.nextInt();

        int result = 0;
        if(n <= m){
            result = 2;
        }else{
            result = (int) Math.ceil((2.0*n)/m);
        }

        System.out.println(result);
    }
}